<link rel="stylesheet" href="<{$_static}>/css/style.css">
<link rel="stylesheet" href="__PUBLIC__/kindeditor-4.1.10/themes/default/default.css" />
<script charset="utf-8" src="__PUBLIC__/kindeditor-4.1.10/kindeditor-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/kindeditor-4.1.10/lang/zh_CN.js"></script>
<load href="__PUBLIC__/Js/Calendar.js" />
<script type="text/javascript">
    var editor ;
	KindEditor.ready(function(K) {
		
		editor = K.create('textarea[name="rule_reply"]', {
			
			allowImageUpload : true,
			newlineTag : "br",
			items : [  'undo','redo','link','unlink','wordpaste','removeformat','source'],
			uploadJson : '<{:U("Kindeditor/uploadJson")}>',

		});
					var editor = K.editor({
					allowFileManager : true
				});
				
				K('#J_selectImage').click(function() {
				editor= K.editor({
	                uploadJson : '<{:U("Kindeditor/uploadJson?width=155&height=210")}>',
					allowFileManager : true
				});
					editor.loadPlugin('multiimage', function() {
						editor.plugin.multiImageDialog({
							clickFn : function(urlList) {
								K.each(urlList, function(i, data) {
									appendImg(data.url)
								});
								editor.hideDialog();
							}
						});
					});
				});
				
	 
	});
	
 
 

</script>
<div class="page-content" >
	<div class="panel panel-default">
		<div class="panel-heading">
           <ul class="breadcrumb">
			<li><a href="<{:addons_url('index',array('type'=>$type))}>"><{:($type==1?"帖子":"下载")}>管理</a> </li>
			<li class="active">添加/修改<{:($type==1?"帖子":"下载")}></li>
		</ul>
        </div>
		
		<div class="panel-body">
			<form class="form-horizontal" action="<{:addons_url('actadd')}>" method="post" id="myform">
				<input type="hidden"  name="id" value="<{$data.id}>">
				<input type="hidden"  name="type" value="<{$type}>">
			 
						<div class="form-group">
							<label  class="col-sm-2 control-label">规则名</label>
							<div class="col-sm-7">
								<input type="text" class="form-control" id="rule_head" name="rule_head" value="<{$data.rule_head}>">
							</div>
							<div class="col-sm-3"></div>
						</div>
						<div class="form-group">
							<label  class="col-sm-2 control-label">关键字</label>
							<div class="col-sm-7">
								<input type="text" placeholder="多个关键字以半角逗号分开"  class="form-control" id="rule_keyword" name="rule_keyword" value="<{$data.rule_keyword}>">
								 </div>
								<div class="col-sm-3"></div>
						</div>
						<div class="form-group">
							<label for="textarea-content" class="col-sm-2 control-label"> 回复</label>
							<div class="col-sm-7">
								<textarea style="width: 680px; height: 300px;" class="input_a1" id="textarea-content" name="rule_reply" rows="2"><{$data.rule_reply}></textarea>
							</div>
						</div>
						 <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-7">
                        <button type="submit" class="btn btn-primary">保存</button>
                    </div>
                </div>
					 
				 
			</form>
		</div>
	</div>
</div>
<script>
 
$(function(){
    $(".form-horizontal").bootstrapValidator({
        message: '您填入的值不合法',
        fields:{
            rule_head: {
                message: '规则名名称',
                validators: {
                    notEmpty: {
                        message: '规则名不能为空'
                    },
                }
            },
			rule_keyword: {
                message: '关键字',
                validators: {
                    notEmpty: {
                        message: '关键字不能为空'
                    },
                }
            },
			  

        }
    });
	
 
});
 </script>